package huawei.dpoint;

import java.util.Arrays;

public class J27 {
    public static void main(String[] args){
        System.out.println(removeElement(new int[]{3,2,2,3},2));
    }
    public static int removeElement(int[] nums, int val) {
        int write =0;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]!=val) {
                nums[write++]=nums[i];
            }
        }
        System.out.println(Arrays.toString(nums));
        return write;
    }
}
